package be.tihh.mgmt.tasks;

public class TestTask extends ComputerTask {

    private String name = "Test Task";

    public String getName() {
        return name;
    }

    @Override
    public void execute() {
        super.execute();
        taskStatus.setStatus(TaskStatus.RUNNING);
        try {

            testRegistry();

/*
            System.out.println("Test Task   0%");
            Thread.sleep(1000);
            System.out.println("Test Task  33%");
            Thread.sleep(1000);
            System.out.println("Test Task  66%");
*/
            Thread.sleep(1000);
            System.out.println("Test Task 100%");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        taskStatus.setStatus(TaskStatus.FINISHED_OK);
        System.out.println("end test task");
    }

    private void testRegistry() {

        RegistryReader registryReader = new RegistryReader();
        registryReader.initialize(computer);
        registryReader.execute();

    }
}
